/************
Ten tac gia : Ly Thien kim
Ngay tao : 8/16/2011
Noi dung : Delete 1 CRIME_DETAIL
************/
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE NAME = 'sp_DeleteCRIME_DETAIL')
BEGIN
	DROP PROC sp_DeleteCRIME_DETAIL
END
GO
CREATE PROC sp_DeleteCRIME_DETAIL
	@ID					int,
	@IDCRIMINAL			int,
	@IDCOMPLAINT		int,
	@Result				int out
	AS
	BEGIN
		IF EXISTS (SELECT * FROM CRIME_DETAIL WHERE  @ID = ID and @IDCRIMINAL = IDCRIMINAL and @IDCOMPLAINT = IDCOMPLAINT)
		BEGIN
			DELETE FROM CRIME_DETAIL
			WHERE @ID = ID and @IDCRIMINAL = IDCRIMINAL and @IDCOMPLAINT = IDCOMPLAINT
			SET @RESULT = 1
		END
		ELSE 
		BEGIN
			SET @RESULT = 0
		END
	END
